<?php
header("Content-Type:text/html; charset=utf-8");

require_once("../../connectMysql/connetMysql.class.php");
$db=new connetMysql;
$con=$db->getConnect();

date_default_timezone_set('prc');
$time1=date('Y-m-d H:i:s',time());
$t1 = strtotime($time1);


$result = mysqli_query($con,"SELECT * FROM user where usermail='".$_POST["usermail"]."'");

if($row = mysqli_fetch_array($result))
  {
  if($row["userstate"]==0)
    {
		$t2 = strtotime($row["registertime"])+60*60*24;
		if($t1>$t2)
		  {
			echo "3";           /////激活码已过期
		  }
		else
		  {
			echo "2";          ////激活码未过期
		  }
    }
  else
    {
    echo "1";                 //////账号已存在并且已激活
    }
  }
else
  {
  echo "0";               ///////账号不存在，可以注册
  }

mysqli_close($con);
?>
